package com.manage.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Building {
    private Integer bid;
    private Integer hid;
    private Housing housing;
    private String bnumber;
    private String bname;

    private Integer rcount;

    private String bdescribe;
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date bhiredate;
    @JsonIgnore
    private String file;

//    public Building(Integer bid, Integer hid, Housing housing, String bnumber, String bname, String bdescribe, Date bhiredate) {
//        this.bid = bid;
//        this.hid = hid;
//        this.housing = housing;
//        this.bnumber = bnumber;
//        this.bname = bname;
//        this.bdescribe = bdescribe;
//        this.bhiredate = bhiredate;
//    }

//    public Building(Integer bid, Integer hid, String bnumber, String bname, String bdescribe, Date bhiredate) {
//        this.bid = bid;
//        this.housing.setHid(hid);
//        this.bnumber = bnumber;
//        this.bname = bname;
//        this.bdescribe = bdescribe;
//        this.bhiredate = bhiredate;
//    }

    public Building(String bnumber, String bname, String bdescribe, Date bhiredate) {
        this.bnumber = bnumber;
        this.bname = bname;
        this.bdescribe = bdescribe;
        this.bhiredate = bhiredate;
    }

    public Building(Integer bid, Housing housing, String bnumber, String bname, Integer rcount, String bdescribe, Date bhiredate) {
        this.bid = bid;
        this.housing = housing;
        this.bnumber = bnumber;
        this.bname = bname;
        this.rcount = rcount;
        this.bdescribe = bdescribe;
        this.bhiredate = bhiredate;
    }

    public Building(Integer bid, String bnumber, String bname, String bdescribe, Date bhiredate) {
        this.bid = bid;
        this.bnumber = bnumber;
        this.bname = bname;
        this.bdescribe = bdescribe;
        this.bhiredate = bhiredate;
    }
}
